<?php

namespace app\yhUtil\type;


class Video extends Base {
    protected $contentType = 'video';

    protected $content = [];

    public function __construct(string $file, $message = []){
        parent::__construct($message);
        $this->setVideo($file);
    }
    public function setVideo(string $videoPath){
        $fileResponse = $this->sendFile($videoPath);
        if($fileResponse['code']==1){
            $imageKey = $fileResponse['data']['videoKey'];
            return $this->setVideoKey($imageKey);
        }
        throw new $fileResponse['msg'];
    }

    public function setVideoKey($videoKey) {
        $this->content['videoKey'] = $videoKey;
        return $this;
    }
}